package com.qhnu.zxjx.exception;

import com.qhnu.zxjx.enums.ICodeConfig;
import com.qhnu.zxjx.enums.SystemCodeEnum;
import lombok.Data;

/**
 * @description: 服务异常类
 * @author: panpei
 * @date: 2019/11/13 13:38
 * @version: 1.0
 **/
@Data
public class ServerException extends RuntimeException {
	private Integer code = SystemCodeEnum.ERROR_SERVER.getCode();

	public ServerException() {
		super();
	}

	public ServerException(ICodeConfig codeEnum) {
		super(codeEnum.getMessage());
		setCode(codeEnum.getCode());
	}

	public ServerException(int code, String message) {
		super(message);
		this.code = code;
	}
}
